package com.example.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.dao.UserMapper;
import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 功能描述：
 *验证用户登录
 * @Author: Zhanghf
 * @Date: 2021/5/20 17:26
 */
@Service
public class LoginService {
@Autowired(required = false)
private UserMapper userMapper;
public boolean checking(String name,String password)
{
    User user = userMapper.selectOne(new QueryWrapper<User>().eq("name", name).eq("password", password));
    if(user!=null)
    {
        return true;
    }else {
        return false;
    }
}
}
